package com.stu.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;

public class ZyAspect {
	public void before() {
		System.out.println("before");
	}
	public void afterReturning() {
		System.out.println("afterReturn");
	}
	public void throwException(Throwable e) throws Exception{
		System.out.println("thorwExceptionAdvice"+e.getMessage());
	}
	public void after() {
		System.out.println("after");
	}
//定义环绕通知时，必须传入一个ProceedingJoinPoint类型的参数
	public void around(ProceedingJoinPoint pro) throws Throwable{
		System.out.println("环绕通知前");
		//使用ProceedingJoinPoint.proceed()方法调用被通知的方法
		pro.proceed();
		System.out.println("环绕通知后");
	}
	public void aroundInit(ProceedingJoinPoint pro,String bizName,int times) throws Throwable{
		System.out.println(bizName +"   " +times);
		System.out.println("环绕通知前 init");
		pro.proceed();
		System.out.println("环绕通知后 init");
	}

}
